package main

import (
	"fmt"
)

type A struct {
	Name string
	age int
}

func (a *A) SayOk()  {
	fmt.Println("A sayOk",a.Name)
}

func (a *A) hello()  {
	fmt.Println("A hello",a.Name)
}

type B struct {
	A
}

func main(){
	var b B
	b.A.Name = "tom"
	b.A.age = 8
	b.A.SayOk() // A sayOk tom
	b.A.hello() // A hello tom
	
	b.Name = "jack"
	b.age = 10
	b.SayOk() // A sayOk jack
	b.hello() // A hello jack
}